import { defHttp } from "@/utils/http";

// ERP 资产维修付款情况 VO
export interface PropertyPmtstatesVO {
	id: number; // ID
	parentId: number; // 父级ID
	name: string; // 付款情况名称
	sqNumb: number; // 付款情况顺序
	status: string; // 状态
}

// ERP 资产维修付款情况 API
export const PropertyPmtstatesApi = {
	// 查询资产维修付款情况分页
	getPropertyPmtstatesPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/asm-pmtstates/page`, params });
	},

	// 查询资产维修付款情况详情
	getPropertyPmtstates: async (id: number) => {
		return await defHttp.get({ url: `/whs/asm-pmtstates/get?id=` + id });
	},

	// 新增资产维修付款情况
	createPropertyPmtstates: async (data: PropertyPmtstatesVO) => {
		return await defHttp.post({ url: `/whs/asm-pmtstates/create`, data });
	},

	// 修改资产维修付款情况
	updatePropertyPmtstates: async (data: PropertyPmtstatesVO) => {
		return await defHttp.put({ url: `/whs/asm-pmtstates/update`, data });
	},

	// 删除资产维修付款情况
	deletePropertyPmtstates: async (id: number) => {
		return await defHttp.delete({
			url: `/whs/asm-pmtstates/delete?id=` + id
		});
	},

	// 导出资产维修付款情况 Excel
	exportPropertyPmtstates: async (params: any) => {
		return await defHttp.download({ url: `/whs/asm-pmtstates/export-excel`, params });
	}
};
